import request from '@/util/request/request.ts'
/***    
request.globalRequest(url,请求方式,obj数据,123,true单,true 多array)url, method, data, power, isUpload, isFiles
1===没登录前的请求头
2===携带请求头token
3===刷新token
***/
const apiUser = {}
//  绑定或换绑手机号
apiUser.bindingPhone = (data) => request.globalRequest({url:`/mobile/user/bindingPhone`, method:'PUT',data,power:2})
// 获取当前客户登录信息
apiUser.getUerDetail = () => request.globalRequest({url:`/mobile/user/getUerDetail`, method:'GET',power:2})
// 修改密码
apiUser.updatePwd = (data) => request.globalRequest({url:`/mobile/user/updatePwd`, method:'PUT',data,power:2})
// 编辑个人资料
apiUser.updateUserInfo = (data) => request.globalRequest({url:`/mobile/user/updateUserInfo`, method:'PUT',data,power:2})
// 上传头像
apiUser.uploadAvatar = (data) => request.globalRequest({url:`/mobile/file/annex/avatarUpload`, method:'POST',data,power:2,isUpload:true})
// 新增修改地址
apiUser.saveUserContactAddress = (data) => request.globalRequest({url:`/mobile/user/saveUserContactAddress`, method:'POST',data,power:2})
// 注销账号
apiUser.cancelAccount=()=>request.globalRequest({url:`/mobile/user/cancelAccount`,method:'get',power:2})
export default apiUser